package com.example.education.Mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.education.Bean.StudentInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 姚
 * @since 2023-03-27
 */


@Mapper
public interface StudentInfoMapper extends BaseMapper<StudentInfo> {


    //    @Insert("INSERT into student_info")
//    int insert(StudentInfo studentInfo);
    //增
    @Override
    int insert(StudentInfo studentInfo);


    @Insert("INSERT into student_info (uid,name,gender,age,phone,major,degree ,grade,target_Major,target_University,english_Level,pass_word,target_Foreign,average_Score) VALUES (#{uid},#{name},#{gender},#{age},#{phone},#{major},#{degree},#{grade},#{targetMajor},#{targetUniversity},#{englishLevel},#{password},#{targetForeignUniversity},#{averageScore})")
    int insert1(StudentInfo studentInfo);


    //查
    @Select("SELECT * FROM student_Info WHERE phone=#{phone} ")
    StudentInfo select(String phone);

    //根据uid查
    @Select("SELECT * FROM student_Info WHERE uid=#{uid} ")
    StudentInfo selectByUid(Integer uid);

    //改
    @Override
    int update(@Param("et") StudentInfo studentInfo, @Param("ew") Wrapper<StudentInfo> updateWrapper);
}
